//
// Created by 束庆乐 on 2024/12/29.
//

#include "iostream"
using namespace std;

int main022(){
    int arr1[2][2];
    arr1[0][0] = 1;
    arr1[0][1] = 2;
    arr1[1][0] = 3;
    arr1[1][1] = 4;
    int arr2[2][2] = {{1,2},{3,4}};
    int arr3[2][2] = {1,2,3,4};
    int arr4[][2] = {1,2,3,4};

    cout << "============arr1=============" << endl;
    for (int i = 0; i < 2; ++i) {
        for (int j = 0; j < 2; ++j) {
            cout << arr1[i][j] << " ";
        }
    }
    cout << endl;
    cout << "============arr2=============" << endl;
    for (int i = 0; i < 2; ++i) {
        for (int j = 0; j < 2; ++j) {
            cout << arr2[i][j] << " ";
        }
    }
    cout << endl;
    cout << "============arr3=============" << endl;
    for (int i = 0; i < 2; ++i) {
        for (int j = 0; j < 2; ++j) {
            cout << arr3[i][j] << " ";
        }
    }
    cout << endl;
    cout << "============arr4=============" << endl;
    for (int i = 0; i < 2; ++i) {
        for (int j = 0; j < 2; ++j) {
            cout << arr4[i][j] << " ";
        }
    }
    cout << endl;

    cout << "二维数组大小：" << sizeof(arr1) << endl;
    cout << "二维数组一行大小：" << sizeof(arr1[0]) << endl;
    cout << "二维数组元素大小：" << sizeof(arr1[0][0]) << endl;
    cout << "二维数组列数：" << sizeof(arr1[0])/sizeof(arr1[0][0])<< endl;
    cout << "二维数组地址：" << arr1 << endl;
    cout << "二维数组第一行地址：" << arr1[0] << endl;
    cout << "二维数组第二行地址：" << arr1[1] << endl;
    cout << "二维数组第一个元素地址：" << &arr1[0][0] << endl;
    cout << "二维数组第二个元素地址：" << &arr1[0][1] << endl;

    return 0;
}